/**
 * Created with JetBrains PhpStorm.
 * User: power_yin
 * Date: 13-10-8
 * Time: 上午5:16
 * To change this template use File | Settings | File Templates.
 */
(function(xf, $App){
    $App.fixedTop = function(fixedWrapSelector){
        var subNavbar = $(fixedWrapSelector),
            subNavbarTop = $(fixedWrapSelector).offset().top;
        $(window).on('scroll', function( event ){
            if( $(this).scrollTop() > subNavbarTop ){
                subNavbar.addClass('fixed-top');
            }else{
                subNavbar.removeClass('fixed-top');
            }
        });
    };
})(XF || (XF = {}), $App );